home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 010a / lamenu10.zip / LMSETUP.BC < prev    next >
Text File  |  1991-01-20  |  14KB  |  747 lines

  1. :start
  2. cls
  3. let %!y = 0
  4. locate 5 28
  5. echonolf Color Display (Y,N) ???\\0
  6. getkey
  7. if errlevel 89 echo \\27[46;34m
  8. if errlevel 121 echo \\27[46;34m
  9. cls
  10. let %!y = 0
  11. gosub display
  12. goto begin
  13. :display
  14. cls
  15. locate 1 23
  16. echo LaMenu System v1.0 - Setup Utility
  17. return
  18. :m_display
  19. cls
  20. locate 1 18
  21. echo LaMenu System v1.0 - Creating %!a
  22. return
  23. :begin
  24. locate 4 32
  25. echo Select Menu Type
  26. locate 7 27
  27. echo 1 - 12 Selection Main Menu
  28. locate 8 27
  29. echo 2 - 4 Selection Sub Menu
  30. locate 9 27
  31. echo 3 - 6 Selection Sub Menu
  32. locate 10 27
  33. echo 4 - 8 Selection Sub Menu
  34. locate 11 27
  35. echo 5 - 12 Selection Sub Menu
  36. locate 13 33
  37. echo [ESC] To Cancel
  38. :input
  39. locate 15 40
  40. getkey
  41. if errlevel 27 goto end
  42. if errlevel 49 goto main_menu
  43. if errlevel 50 let %!m = 4
  44. if errlevel 51 let %!m = 6
  45. if errlevel 52 let %!m = 8
  46. if errlevel 53 let %!m = 12
  47. cls
  48. gosub display
  49. locate 3 2
  50. echo Enter the DOS filename for this menu ══════════\\16
  51. locate 4 2
  52. echo (do not include an extension)
  53. :fbk
  54. locate 3 50
  55. read %!f
  56. upper %!f
  57. if #%!f = # goto fbk
  58. let %!x = %!f
  59. find_string %!x .
  60. do_if not %!x = 0
  61. locate 3 50
  62. echo \\27[K
  63. goto fbk
  64. end_if
  65. locate 6 2
  66. echo Enter the Menu Name for display ═══════════════\\16
  67. :nbk
  68. locate 6 50
  69. read %!a
  70. if .%!a = . goto nbk
  71. locate 8 2
  72. echo Enter the drive letter for the menu ═══════════\\16
  73. locate 9 2
  74. echo (include the colon - EXAMPLE - C:)
  75. :dbk
  76. locate 8 50
  77. read %!b
  78. upper %!b
  79. let %!x = %!b
  80. find_string %!x :
  81. do_if %!x = 0
  82. locate 8 50
  83. echo \\27[k
  84. goto dbk
  85. end_if
  86. locate 11 2
  87. echo Enter the directory the menu will be kept in ══\\16
  88. locate 12 2
  89. echo (Include the backslash - EXAMPLE - \MENU)
  90. :drbk
  91. locate 11 50
  92. read %!c
  93. upper %!c
  94. let %!x = %!c
  95. find_string %!x \
  96. do_if %!x = 0
  97. locate 11 50
  98. echo \\27[k
  99. goto drbk
  100. end_if
  101. locate 15 2
  102. echo Creating %!m Selection Sub Menu %!b%!c\%!f.BAT
  103. locate 16 2
  104. echo Titled - m%!a
  105. :re
  106. locate 18 27
  107. echonolf Is This Correct (Y,N) ??\\0
  108. read %!i
  109. upper %!i
  110. if %!i = N goto start
  111. if %!i = Y goto cont
  112. if not %!i = Y goto re
  113. :cont
  114. if exist %!f.bat gosub overwrite
  115. if exist %!f.ctl gosub overwrite
  116. if exist %!f.dsp gosub overwrite
  117. gosub display
  118. locate 4 2
  119. echo Enter the DOS filename for the menu this sub menu ═\\16
  120. locate 5 2
  121. echo will be linked to (do not include an extension - EXAMPLE - MAIN)
  122. :fnbk
  123. locate 4 54
  124. read %!d
  125. upper %!d
  126. let %!x = %!d
  127. find_string %!x .
  128. do_if not %!x = 0
  129. locate 4 54
  130. echo \\27[k
  131. goto fnbk
  132. end_if
  133. locate 7 2
  134. echo Enter the drive of the linked menu
  135. locate 8 2
  136. echo (Include the colon:) ═════════════════════════════\\16
  137. :dlbk
  138. locate 8 54
  139. read %!w
  140. upper %!w
  141. let %!x = %!w
  142. find_string %!x :
  143. do_if %!x = 0
  144. locate 8 54
  145. echo \\27[k
  146. goto dlbk
  147. end_if
  148. locate 10 2
  149. echo Enter the directory of the linked menu
  150. locate 11 2
  151. echo (Include the backslash \) ════════════════════════\\16
  152. :drlbk
  153. locate 11 54
  154. read %!e
  155. upper %!e
  156. let %!x = %!e
  157. find_string %!x \
  158. do_if %!x = 0
  159. locate 11 54
  160. echo \\27[k
  161. goto drlbk
  162. end_if
  163. gosub display
  164. locate 4 2
  165. echo Creating %!m Selection Sub Menu %!b%!c\%!f.BAT
  166. locate 5 2
  167. echo Titled - %!a
  168. let %!n = %!m
  169. add %!n 1
  170. let %!h = 1
  171. echo %!a >%!f.dsp
  172. echo ECHO OFF >%!f.bat
  173. echo SET SC=\\37RC\\37>>%!f.bat
  174. echo SET RC=>>%!f.bat
  175. echo :BEGIN>>%!f.bat
  176. echo LAMENU%!m %!f>>%!f.bat
  177. do_while not %!h = %!n
  178. echo IF \\37LM\\37 == %!h GOTO %!h>>%!f.bat
  179. add %!h 1
  180. end_while
  181. echo IF \\37LM\\37 == EX GOTO END>>%!f.bat
  182. let %!h = 1
  183. do_while not %!h = %!n
  184. echo :%!h>>%!f.bat
  185. gosub m_display
  186. locate 4 2
  187. echo Enter The Display Name For Selection %!h═══════\\16
  188. locate 5 2
  189. echo Press Enter To End Setup - Enter * To Skip Selection
  190. locate 4 50
  191. read %!l
  192. if .%!l = . goto end_select
  193. if %!l = * goto skip_select
  194. locate 7 2
  195. echo Enter The DOS Executable Filename ═════════════\\16
  196. :defn
  197. locate 7 50
  198. read %!k
  199. upper %!k
  200. do_if #%!k = #
  201. locate 7 50
  202. echo \\27[k
  203. goto defn
  204. end_if
  205. locate 9 2
  206. echo Enter The Drive Letter (include the colon :) ══\\16
  207. :fdlbk
  208. locate 9 50
  209. read %!j
  210. upper %!j
  211. let %!x = %!j
  212. find_string %!x :
  213. do_if %!x = 0
  214. locate 9 50
  215. echo \\27[k
  216. goto fdlbk
  217. end_if
  218. locate 11 2
  219. echo Enter The Directory (include backslashes \) ═══\\16
  220. :fdrbk
  221. locate 11 50
  222. read %!i
  223. upper %!i
  224. let %!x = %!i
  225. find_string %!x \
  226. do_if %!x = 0
  227. locate 11 50
  228. echo \\27[k
  229. goto fdrbk
  230. end_if
  231. let %!g = 0
  232. locate 13 2
  233. echo 1.  Return to this menu
  234. locate 14 2
  235. echo 2.  Return to previous linked menu
  236. locate 15 2
  237. echo 3.  Exit menus completely
  238. locate 16 12
  239. echonolf Select which ending (1,2,3) ??\\0
  240. getkey
  241. if errlevel 49 let %!g = 1
  242. if errlevel 50 let %!g = 2
  243. if errlevel 51 let %!g = 3
  244. if %!g = 3 goto next
  245. locate 18 2
  246. echonolf Do You Wish A Pause Before Returning To The Menu (Y,N) ?\\0
  247. read %!p
  248. upper %!p
  249. if %!p = Y add %!g 3
  250. :next
  251. echo %!l>>%!f.dsp
  252. gosub pass
  253. do_if %!g = 3
  254. echo SET RC=>>%!f.bat
  255. echo SET LM=>>%!f.bat
  256. echo SET SC=>>%!f.bat
  257. end_if
  258. if not %!b == %!j echo %!j>>%!f.bat
  259. if not %!c == %!i echo CD %!i>>%!f.bat
  260. echo %!k>>%!f.bat
  261. do_if %!g = 3
  262. echo CLS>>%!f.bat
  263. echo GOTO EXIT>>%!f.bat
  264. goto next_1
  265. end_if
  266. if %!g = 4 echo PAUSE \\62NULL>>%!f.bat
  267. if %!g = 5 echo PAUSE \\62NULL>>%!f.bat
  268. if not %!b == %!j echo %!b>>%!f.bat
  269. if not %!c == %!i echo CD %!c>>%!f.bat
  270. if %!g = 1 echo GOTO BEGIN>>%!f.bat
  271. if %!g = 4 echo GOTO BEGIN>>%!f.bat
  272. if %!g = 2 echo GOTO END>>%!f.bat
  273. if %!g = 5 echo GOTO END>>%!f.bat
  274. :next_1
  275. add %!h 1
  276. end_while
  277. goto end_sub
  278. :skip_select
  279. echo * >>%!f.dsp
  280. echo GOTO BEGIN >>%!f.bat
  281. goto next_1
  282. :end_select
  283. echo GOTO BEGIN>>%!f.bat
  284. echo \\42>>%!f.dsp
  285. add %!h 1
  286. do_while not %!h = %!n
  287. echo :%!h>>%!f.bat
  288. echo GOTO BEGIN>>%!f.bat
  289. echo \\42>>%!f.dsp
  290. add %!h 1
  291. end_while
  292. :end_sub
  293. echo \\26>>%!f.dsp
  294. echo :END>>%!f.bat
  295. echo SET RC=\\37SC\\37>>%!f.bat
  296. if not %!b == %!w echo %!w>>%!f.bat
  297. if not %!c == %!e echo CD %!w>>%!f.bat
  298. echo %!d>>%!f.bat
  299. echo :EXIT>>%!f.bat
  300. cls
  301. exit
  302. :pass
  303. locate 20 10
  304. echo Type The Password For This Selection - Press Enter For None
  305. locate 21 35
  306. echo \\218\\196\\196\\196\\196\\196\\196\\196\\196\\191
  307. locate 22 35
  308. echonolf \\179
  309. locate 22 44
  310. echo \\179
  311. locate 23 35
  312. echo \\192\\196\\196\\196\\196\\196\\196\\196\\196\\217
  313. locate 24 15
  314. echo Press Enter When Done (password is case sensitive)
  315. :L1
  316. locate 22 36
  317. getkey
  318. error_level %!o
  319. if not %!o = 13 echonolf \\42
  320. if %!o = 13 return
  321. :L2
  322. locate 22 37
  323. getkey
  324. error_level %!p
  325. if %!p = 13 goto check1
  326. if %!p = 8 goto L2a
  327. echonolf \\42
  328. goto L3
  329. :L2a
  330. locate 22 36
  331. echonolf \\0
  332. goto L1
  333. :L3
  334. locate 22 38
  335. getkey
  336. error_level %!q
  337. if %!q = 13 goto check2
  338. if %!q = 8 goto L3a
  339. echonolf \\42
  340. goto L4
  341. :L3a
  342. locate 22 37
  343. echonolf \\0
  344. goto L2
  345. :L4
  346. locate 22 39
  347. getkey
  348. error_level %!r
  349. if %!r = 13 goto check3
  350. if %!r = 8 goto L4a
  351. echonolf \\42
  352. goto L5
  353. :L4a
  354. locate 22 38
  355. echonolf \\0
  356. goto L3
  357. :L5
  358. locate 22 40
  359. getkey
  360. error_level %!s
  361. if %!s = 13 goto check4
  362. if %!s = 8 goto L5a
  363. echonolf \\42
  364. goto L6
  365. :L5a
  366. locate 22 39
  367. echonolf \\0
  368. goto L4
  369. :L6
  370. locate 22 41
  371. getkey
  372. error_level %!t
  373. if %!t = 13 goto check5
  374. if %!t = 8 goto L6a
  375. echonolf \\42
  376. goto L7
  377. :L6a
  378. locate 22 40
  379. echonolf \\0
  380. goto L5
  381. :L7
  382. locate 22 42
  383. getkey
  384. error_level %!u
  385. if %!u = 13 goto check6
  386. if %!u = 8 goto L7a
  387. echonolf \\42
  388. goto L8
  389. :L7a
  390. locate 22 41
  391. echonolf \\0
  392. goto L6
  393. :L8
  394. locate 22 43
  395. getkey
  396. error_level %!v
  397. if %!v = 13 goto check7
  398. if %!v = 8 goto L8a
  399. echonolf \\42
  400. goto check8
  401. :L8a
  402. locate 22 42
  403. echonolf \\0
  404. goto L7
  405. :check1
  406. let %!x = %!o
  407. goto pass_back
  408. :check2
  409. let %!x = %!o%!p
  410. goto pass_back
  411. :check3
  412. let %!x = %!o%!p%!q
  413. goto pass_back
  414. :check4
  415. let %!x = %!o%!p%!q%!r
  416. goto pass_back
  417. :check5
  418. let %!x = %!o%!p%!q%!r%!s
  419. goto pass_back
  420. :check6
  421. let %!x = %!o%!p%!q%!r%!s%!t
  422. goto pass_back
  423. :check7
  424. let %!x = %!o%!p%!q%!r%!s%!t%!u
  425. goto pass_back
  426. :check8
  427. getkey
  428. error_level %!z
  429. if %!z = 13 goto go8
  430. if %!z = 8 goto re8
  431. beep
  432. goto check8
  433. :re8
  434. locate 15 43
  435. echonolf \\0
  436. goto L8
  437. :go8
  438. let %!x = %!o%!p%!q%!r%!s%!t%!u%!v
  439. :pass_back
  440. add %!y 1
  441. echo %!x>>%!f.ctl
  442. echo LMCNTL %!f %!y>>%!f.bat
  443. echo IF \\37LM\\37 == 86 GOTO BEGIN>>%!f.bat
  444. return
  445. :main_menu
  446. cls
  447. let %!m = 12
  448. gosub display
  449. locate 3 2
  450. echo Enter the DOS filename for this menu ══════════\\16
  451. locate 4 2
  452. echo m(do not include an extension)
  453. :mfbk
  454. locate 3 50
  455. read %!f
  456. upper %!f
  457. let %!x = %!f
  458. find_string %!x .
  459. do_if not %!x = 0
  460. locate 3 50
  461. echo \\27[k
  462. goto mfbk
  463. end_if
  464. locate 6 2
  465. echo Enter the Menu Name for display ═══════════════\\16
  466. :mnbk
  467. locate 6 50
  468. read %!a
  469. do_if .%!a = .
  470. locate 6 50
  471. echo \\27[k
  472. goto mnbk
  473. end_if
  474. locate 8 2
  475. echo Enter the drive letter for the menu ═══════════\\16
  476. locate 9 2
  477. echo (include the colon - EXAMPLE - C:)
  478. :mdbk
  479. locate 8 50
  480. read %!b
  481. upper %!b
  482. let %!x = %!b
  483. find_string %!x :
  484. do_if %!x = 0
  485. locate 8 50
  486. echo \\27[k
  487. goto mdbk
  488. end_if
  489. locate 11 2
  490. echo Enter the directory the menu will be kept in ══\\16
  491. locate 12 2
  492. echo (Include the backslash - EXAMPLE - \MENU)
  493. :mdrbk
  494. locate 11 50
  495. read %!c
  496. upper %!c
  497. let %!x = %!c
  498. find_string %!x \
  499. do_if %!x = 0
  500. locate 11 50
  501. echo \\27[k
  502. goto mdrbk
  503. end_if
  504. locate 15 2
  505. echo Creating LaMenu Main Menu %!b%!c\%!f.BAT
  506. locate 16 2
  507. echo  Titled %!a
  508. :re_main
  509. locate 18 27
  510. echonolf Is This Correct (Y,N) ??\\0
  511. read %!i
  512. upper %!i
  513. if %!i = N goto main_menu
  514. if %!i = Y goto cont_main
  515. if not %!i = Y goto re_main
  516. :cont_main
  517. if exist %!f.bat gosub overwrite
  518. if exist %!f.ctl gosub overwrite
  519. if exist %!f.dsp gosub overwrite
  520. gosub display
  521. locate 4 2
  522. echo Creating LaMenu Main Menu %!b%!c\%!f.BAT
  523. echo  Titled - %!a
  524. let %!n = %!m
  525. add %!n 1
  526. let %!h = 1
  527. echo %!a >%!f.dsp
  528. echo ECHO OFF >%!f.bat
  529. echo :BEGIN>>%!f.bat
  530. echo LAMENU %!f>>%!f.bat
  531. do_while not %!h = %!n
  532. echo IF \\37LM\\37 == %!h GOTO %!h>>%!f.bat
  533. add %!h 1
  534. end_while
  535. echo IF \\37LM\\37 == F1 GOTO F1>>%!f.bat
  536. echo IF \\37LM\\37 == F2 GOTO F2>>%!f.bat
  537. echo IF \\37LM\\37 == F3 GOTO F3>>%!f.bat
  538. echo IF \\37LM\\37 == F4 GOTO F4>>%!f.bat
  539. echo IF \\37LM\\37 == EX GOTO END>>%!f.bat
  540. let %!h = 1
  541. do_while not %!h = %!n
  542. echo :%!h>>%!f.bat
  543. gosub m_display
  544. locate 4 2
  545. echo Enter The Display Name For Selection %!h ══════\\16
  546. locate 5 2
  547. echo Press Enter To End Setup - Enter * To Skip Selection
  548. :mdlbk
  549. locate 4 50
  550. read %!l
  551. do_if .%!l = .
  552. locate 4 50
  553. echo \\27[k
  554. goto mdlbk
  555. end_if
  556. if .%!l = . goto end_select_m
  557. if %!l = * goto skip_select_m
  558. locate 7 2
  559. echo Enter The DOS Executable Filename ═════════════\\16
  560. :mfnbk
  561. locate 7 50
  562. read %!k
  563. upper %!k
  564. do_if #%!k = #
  565. locate 7 50
  566. echo \\27[k
  567. goto mfnbk
  568. end_if
  569. locate 9 2
  570. echo Enter The Drive Letter (include the colon :) ══\\16
  571. :mdrlbk
  572. locate 9 50
  573. read %!j
  574. upper %!j
  575. let %!x = %!j
  576. find_string %!x :
  577. do_if %!x = 0
  578. locate 9 50
  579. echo \\27[k
  580. goto mdrlbk
  581. end_if
  582. locate 11 2
  583. echo Enter The Directory (include backslashes \) ═══\\16
  584. :mfdrbk
  585. locate 11 50
  586. read %!i
  587. upper %!i
  588. let %!x = %!i
  589. find_string %!x \
  590. do_if %!x = 0
  591. locate 11 50
  592. echo \\27[k
  593. goto mfdrbk
  594. end_if
  595. locate 13 2
  596. echonolf Do You Wish To Exit This Menu Upon Execution (Y,N) ?\\0
  597. read %!g
  598. upper %!g
  599. if %!g = Y let %!g = M
  600. if %!g = M goto next_m
  601. locate 15 2
  602. echonolf Do You Wish A Pause Before Returning To The Menu (Y,N) ?\\0
  603. read %!g
  604. upper %!g
  605. :next_m
  606. echo %!l>>%!f.dsp
  607. gosub pass
  608. if not %!b == %!j echo %!j>>%!f.bat
  609. if not %!c == %!i echo CD %!i>>%!f.bat
  610. echo %!k>>%!f.bat
  611. if %!g = M echo GOTO END>>%!f.bat
  612. if %!g = M goto next_m_1
  613. if %!g = Y echo PAUSE \\62NULL>>%!f.bat
  614. if not %!b == %!j echo %!b>>%!f.bat
  615. if not %!c == %!i echo CD %!c>>%!f.bat
  616. echo GOTO BEGIN>>%!f.bat
  617. :next_m_1
  618. add %!h 1
  619. end_while
  620. goto f_select
  621. :skip_select_m
  622. echo * >>%!f.dsp
  623. echo GOTO BEGIN >>%!f.bat
  624. goto next_m_1
  625. :end_select_m
  626. echo GOTO BEGIN>>%!f.bat
  627. echo \\42>>%!f.dsp
  628. add %!h 1
  629. do_while not %!h = %!n
  630. echo :%!h>>%!f.bat
  631. echo GOTO BEGIN>>%!f.bat
  632. echo \\42>>%!f.dsp
  633. add %!h 1
  634. end_while
  635. :f_select
  636. let %!h = 1
  637. do_while not %!h = 5
  638. echo :F%!h>>%!f.bat
  639. gosub m_display
  640. locate 4 2
  641. echo Enter The Display Name For F%!h (max 14 chrs) ═\\16
  642. locate 5 2
  643. echo Press Enter To End Setup - Enter * To Skip Selection
  644. locate 4 50
  645. read %!l
  646. if .%!l = . goto end_select_f
  647. if %!l = * goto skip_select_f
  648. locate 7 2
  649. echo Enter The DOS Executable Filename ═════════════\\16
  650. :ffnbk
  651. locate 7 50
  652. read %!k
  653. upper %!k
  654. do_if #%!k = #
  655. locate 7 50
  656. echo \\27[k
  657. goto ffnbk
  658. end_if
  659. locate 9 2
  660. echo Enter The Drive Letter (include the colon :) ══\\16
  661. :fdrlbk
  662. locate 9 50
  663. read %!j
  664. upper %!j
  665. let %!x = %!j
  666. find_string %!x :
  667. do_if %!x = 0
  668. locate 9 50
  669. echo \\27[k
  670. goto fdrlbk
  671. end_if
  672. locate 11 2
  673. echo Enter The Directory (include backslashes \) ═══\\16
  674. :fdirbk
  675. locate 11 50
  676. read %!i
  677. upper %!i
  678. let %!x = %!i
  679. find_string %!x \
  680. do_if %!x = 0
  681. locate 11 50
  682. echo \\27[k
  683. goto fdirbk
  684. end_if
  685. locate 13 2
  686. echonolf Do You Wish to Exit After Execution (Y,N) ?\\0
  687. read %!g
  688. upper %!g
  689. if %!g = Y goto f_up
  690. locate 15 2
  691. echonolf Do You Wish To Pause Before Returning To The Menu (Y,N) ?\\0
  692. read %!w
  693. upper %!w
  694. :f_up
  695. echo %!l>>%!f.dsp
  696. if not %!b == %!j echo %!j>>%!f.bat
  697. if not %!c == %!i echo CD %!i>>%!f.bat
  698. echo %!k>>%!f.bat
  699. if %!w = Y echo PAUSE \\62NULL>>%!f.bat
  700. if not %!b == %!j echo %!b>>%!f.bat
  701. if not %!c == %!i echo CD %!c>>%!f.bat
  702. if not %!g = Y echo GOTO BEGIN>>%!f.bat
  703. if %!g = Y echo GOTO END>>%!f.bat
  704. :next_f
  705. add %!h 1
  706. end_while
  707. goto f_end
  708. :skip_select_f
  709. echo * >>%!f.dsp
  710. echo GOTO BEGIN >> %!f.bat
  711. goto next_f
  712. :end_select_f
  713. echo GOTO BEGIN>>%!f.bat
  714. echo \\42>>%!f.dsp
  715. add %!h 1
  716. do_while not %!h = 5
  717. echo :F%!h>>%!f.bat
  718. echo GOTO BEGIN>>%!f.bat
  719. echo \\42>>%!f.dsp
  720. add %!h 1
  721. end_while
  722. :F_END
  723. echo \\26>>%!f.dsp
  724. echo :END>>%!f.bat
  725. echo SET RC=>>%!f.bat
  726. echo SET LM=>>%!f.bat
  727. echo SET SC=>>%!f.bat
  728. echo CLS>>%!f.bat
  729. cls
  730. exit
  731. :overwrite
  732. cls
  733. locate 5 2
  734. beep
  735. echonolf Menu File Already Exists - Overwrite (Y,N) ??\\0
  736. read %!i
  737. upper %!i
  738. if %!i = N goto start
  739. if not %!i = Y goto overwrite
  740. del %!f.bat
  741. del %!f.dsp
  742. del %!f.ctl
  743. return
  744. :end
  745. cls
  746. exit
  747.